 # makefile
 # Copyright (C) 12/28/2005, 21:26 Francisco J. Hernández

 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Library General Public
 # License as published by the Free Software Foundation; either
 # version 2 of the License, or (at your option) any later version.

 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 # Library General Public License for more details.

 # You should have received a copy of the GNU Library General Public
 # License along with this library; if not, write to the Free
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

ScriptParser.java:
	~/javacc-4.1/bin/javacc script.jj

clean:
#	rm ScriptParserConstants.java ParseException.java ScriptParser.java ScriptParserTokenManager.java SimpleCharStream.java Token.java TokenMgrError.java
	rm ScriptParserConstants.java ParseException.java ScriptParser.java ScriptParserTokenManager.java SimpleCharStream.java TokenMgrError.java Token.java

doc:
	~/javacc-4.1/bin/jjdoc script.jj

test0:
	echo "wait b microsec" | java ScriptParser
	echo "" | java ScriptParser
	echo "exit" | java ScriptParser
	echo "number id1,id2 string id3 Location _1 call \"prueba.txt\" {break exit}" | java ScriptParser
	echo "call \"prueba.txt\" (100)" | java ScriptParser
	echo "call \"prueba.txt\" (0,a)" | java ScriptParser
	echo "call \"prueba.txt\" (10, 3*id1, \"hola\", [3,100])" | java ScriptParser
	echo "id1 = id2 + 3" | java ScriptParser
	echo "id1 = id2 - (3 * id4 / 3)" | java ScriptParser
	echo "if a < b exit" | java ScriptParser
	echo "if a < b exit else break" | java ScriptParser
	echo "if a+1 < b*3 exit else break" | java ScriptParser
	echo "while a == b exit" | java ScriptParser
	echo "while a = b { exit break if b >= c {c = b b = 1} else {c = c + 1 c = 0}}" | java ScriptParser
	echo "while a = b { exit; break; if b >= c {c = b; b = 1;} else {c = c + 1; c = 0;}}" | java ScriptParser

test1:
	echo "keypress 'K' keyrelease 'K' keypress 'F12' keyrelease 'TAB'" | java ScriptParser
	echo "macroKey a; a = 'K'; keypress a keyrelease a" | java ScriptParser
	echo "if color a == color b exit" | java ScriptParser
	echo "if (color [100,3] == color b) exit" | java ScriptParser
	echo "mousemove [100,2] mousepress button1 wait 3 sec mouserelease button2" | java ScriptParser

test2:
	echo "if (color [100,3] == color b) if (a < b) break else exit" | java ScriptParser
